<?php	 	 
$this->breadcrumbs=array(
	'Laporan Lain Lain'=>array('admin'),
	'Manage',
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').slideToggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('dokumentasi-grid', {
		data: $(this).serialize()
	});
	return false;
});
");

?>

<h1>Laporan Lain Lain</h1>
<?php	 	 
if(Yii::app()->user->checkAccess('satker')){
 $this->widget('bootstrap.widgets.BootButton', array(
        'type'=>'primary',
        'size'=>'mini',
        'label'=>'Buat Laporan Lain Lain',
		'url'=>Yii::app()->createUrl('/eAudit/laporanLainLain/create'),
    )); 
}
	?>

<br /><br />
<?php	 	 
if(!Yii::app()->user->checkAccess('satker') && !Yii::app()->user->checkAccess('wilayah')){
?>
<?php	 	  echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none;">
<?php	 	  $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->
<?php	 	 
}
?>
<?php	 	 
	$this->widget('bootstrap.widgets.BootGridView', array(
    'type'=>'striped bordered condensed',
    'dataProvider'=>$model->search(),
	'template'=>'{items}{pager}',
	'id'=>'dokumentasi-grid',
    'filter'=>$model,
    'columns'=>array(
		'jenis_laporan',
		array(
			'name'=>'nama_laporan',
			'type'=>'html',
			'value'=>'CHtml::link($data->nama_laporan,array("/eAudit/laporanLainLain/view","id"=>$data->id))',
		),
		'tanggal_laporan',
		array(
			'name'=>'satker',
			'value'=>'Satker::model()->find("satker_kode = ".$data->satker)->nama_satker',
		),
		array(
			'name'=>'status',
			'value'=>'substr($data->status,18)',
		),
		array(
			'class'=>'CButtonColumn',
			'template'=>'{view}{update}{delete}',
			'buttons'=>array(
				'update'=>array(
					'visible'=>'!Yii::app()->user->checkAccess("pemeriksa")',
				),
				'delete'=>array(
					'visible'=>'!Yii::app()->user->checkAccess("pemeriksa")',
				),
			),
		),
	),
)); ?>
